﻿@model List<FW_Menu>

@using WebEntities;
@using WebsiteUI.Extensions;

<div class="logo fl">
    <a href="/home"><img src="/Resource/images/logo.png" alt="城市垃圾处理网" /></a>
</div>
<div class="menubox fr">
    <div class="login">
        @{
            string showName = string.Empty;
            if (!Request.IsAuthenticated)
            {
            <span>欢迎来到城市垃圾处理网 <a href="/home/login">会员登录</a>|<a href="/home/register">注册</a>|<a
                href="/home/map">网站地图</a>|<a href="/home">返回首页</a></span>
            }
            else
            {
                WebEntities.FW_Member member = Session["LoginMember"] as WebEntities.FW_Member;
                if (member != null)
                {
                    showName = string.IsNullOrWhiteSpace(member.NickName) ? member.MemberID : member.NickName;
                }
                else
                {
                    showName = HttpContext.Current.User.Identity.Name;
                }
            <span><span class="welcome_name">@showName</span><span>，欢迎来到城市垃圾处理网</span>
                @if ((member.EmailValid ?? 0) == 0)
                {
                    @:<a href="/home/validemail">[验证邮箱]</a>
                                                }
                <a href="/home/logout">退出</a>|<a href="/">返回首页</a> </span>
            }
        }
    </div>

    <div class="menu">
        <ul>
        @foreach (var menu in Model)
        {
            <li class="bm"><a href="@menu.MenuUrl" class="bm-a">@menu.MenuName</a>
            @if (menu.FW_MenuItem != null && menu.FW_MenuItem.Count > 0)
            {
                <div class="sub-menu hidden">
                    <i class="bgPic jt"></i>
                    <ul>
                        @foreach (var muitem in menu.FW_MenuItem)
                        {
                            <li class="sm"><a href="@muitem.ItemUrl">@muitem.ItemName</a></li>
                        }
                    </ul>
                </div>
            }
            </li>
        }
        </ul>
    </div>
</div>
